#ifndef SOFTWARESCAN_H
#define SOFTWARESCAN_H

#pragma once

#include <QObject>
#include <QNetworkReply>
#include "modelversion.h"
// #include "UpdateUtil_global.h"
namespace ns_yht
{

    class /*UPDATEUTIL_EXPORT*/ SoftwareScan : public QObject
    {
        Q_OBJECT
    public:
        SoftwareScan(const QString &code);
        SoftwareScan(const QString &code, const QString &currentVersion);
        ~SoftwareScan();

        void start();

        QSharedPointer<ModelSoftware> getModel() const;

    protected slots:
        void onProcessFinished(QNetworkReply *reply);

    signals:
        void finished();

    private:
        void setModel(const QJsonObject &appObj);

        QSharedPointer<ModelSoftware> m_model;
        QString m_currentVersion;
    };

} // namespace ns_yht
#endif